<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>小飞象-资金管理-转账管理</title>
    <link rel="stylesheet" href="//at.alicdn.com/t/font_810097_mgs6xzz1oj.css">
    <link rel="stylesheet" href="../css/common/reset.css">
    <link rel="stylesheet" href="../layui/css/layui.css">
    <link rel="stylesheet" href="../../css/reset-layui.css">
    <link rel="stylesheet" href="../css/header.css">
    <link rel="stylesheet" href="../css/common/nav.css">
    <link rel="stylesheet" href="../css/common/aside.css">
    <link rel="stylesheet" href="../css/common/content.css">
    <link rel="stylesheet" href="../css/capital.css">
</head>

<body>
    <header>
        <div class="wrapper">
            <div class="clearfix headerBox">
                <h1 class="fl logo">
                    <a href="">小飞象</a>
                </h1>
                <!-- <div class="fl alipayName">支付宝充值账号: <b class="redColor">156****8656</b>开户人: <b class="redColor">陈小窝</b></div> -->
                <div class="fr logOut">退出</div>
                <div class="fr userName"></div>
            </div>
        </div>
    </header>
    <div class="mhNav">
        <ul class="navMenuBox">
            <li>
                <a href="../index.html" class="active">
                    飞象首页
                </a>
            </li>
            <li>
                <a href="javascript:;">
                    会员中心
                </a>
                <ul class="mhColumnSide">
                    <li>
                        <a href="../member/basicInfo.html">基本资料</a>
                    </li>
                    <li>
                        <a href="../member/storeMage.html">店铺管理</a>
                    </li>
                    <li>
                        <a href="../member/readjustNum.html">调整单量</a>
                    </li>
                    <li>
                        <a href="/goodsMage.html">商品管理</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="javascript:;">
                    计划管理
                </a>
                <ul class="mhColumnSide">
                    <li>
                        <a href="../plan/newPlan.html">新建计划</a>
                    </li>
                    <li>
                        <a href="../plan/planMage.html">计划管理</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="javascript:;">
                    订单管理
                </a>
                <ul class="mhColumnSide">
                    <li>
                        <a href="../order/orderMage.html">订单管理</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="javascript:;">
                    资金管理
                </a>
                <ul class="mhColumnSide">
                    <li>
                        <a href="inAccout.html">账号充值</a>
                    </li>
                    <li>
                        <a href="transferMage.html">转账管理</a>
                    </li>
                    <li>
                        <a href="orderMage/dailyTaskDes.html">订单信息</a>
                    </li>
                    <li>
                        <a href="expressForm.html">获取快递底单</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="">在线客服</a>
            </li>
        </ul>
    </div>
    <div class="clearfix wrapper mainBomContent">
        <div class="asideMenu">
            <h2 class="title">
                <i class="iconfont icon--"></i> 资金管理
            </h2>
            <ul>
                <li>
                    <a href="inAccout.html">账号充值</a>
                </li>
                <li class="active">
                    <a href="transferMage.html">转账管理</a>
                </li>
                <li>
                    <a href="orderMage/dailyTaskDes.html">订单信息</a>
                </li>
                <li>
                    <a href="expressForm.html">获取快递底单</a>
                </li>
            </ul>
        </div>
        <div class="rightContent">
            <div class="transferMageView">
                <!-- <div class="tabNav">
                    <a href="">等待转账</a>
                    <a href="">转账结果</a>
                    <a href="">未收到反馈</a>
                    <a href="">买家已退款</a>
                </div> -->
                <div class="fl transferLx">
                    <h2> 批量转账流程（只支持招商银行）：</h2>
                    <ul>
                        <li>
                            导出转账信息
                        </li>
                        <li>
                            在网银进行<br /> 转让操作
                        </li>
                        <li>
                            返回平台<br />
                            <b class="redColor">标记转账失败</b>
                            订单
                        </li>
                        <li>
                            最后<br />
                            <b class="redColor">标记转账成功</b>
                            订单
                        </li>
                    </ul>
                    <!-- <h2>默认转账银行卡</h2>
                    <div class="bankCard">
                        <h3>招商银行</h3>
                        <p> **** **** **** ***3462</p>
                        <h4>
                            开户人：王建宁 <a href="" onclick="editDefaultBank()">修改</a>
                        </h4>
                    </div> -->
                </div>
                <div class="fr transferDes">
                    <dl>
                        <dt class="titleH3">转账相关规定：</dt>
                        <dd>
                            1、必须在每天
                            <b class="redColor">中午12：00前</b>完成前一天的所有转账，否则任务将被隐藏，并对每笔超时订单处罚2元；
                        </dd>
                        <dd>
                            2、严禁使用支付宝转账，一经发现将终止合作；</dd>
                        <dd>
                            3、对于超时未转账的订单，买家有权申请退款；</dd>
                        <dd>
                            4、对于多次超时的卖家，平台有权终止合作。</dd>
                    </dl>
                    <div class="transferLinkTeach">
                        <ul class="fl yLeftBox">
                            <li>
                                <a href="">
                                    <i class="iconfont icon-xiaolian2"></i>招商银行批量转账教程
                                </a>
                            </li>
                            <li>
                                <a href="">
                                    <i class="iconfont icon-xiaolian2"></i>招商银行批量转账问题汇总
                                </a>
                            </li>
                            <li>
                                <a href="">
                                    <i class="iconfont icon-xiaolian2"></i>卖家转账常见问题
                                </a>
                            </li>
                        </ul>
                        <ul class="fr bRightBox">
                            <li>
                                <a href="">
                                    <i class="iconfont icon-xiaolian2"></i>支付宝免费快速提现秘籍
                                </a>
                            </li>
                            <li>
                                <a href="">
                                    <i class="iconfont icon-xiaolian2"></i>操作按钮使用指南
                                </a>
                            </li>
                            <li>
                                <a href="">
                                    <i class="iconfont icon-xiaolian2"></i>转账状态说明
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="clear" style="clear:both;"></div>
                <div class="cashState">
                    <label>
                        转账状态：</label>
                    <select class="w120" iid="status">
                        <option value="">请选择</option>
                        <option value="-1">记录转账</option>
                        <option value="1">等待转账</option>
                        <option value="1">转账成功</option>
                        <option value="2">转账失败</option>
                    </select>
                    <label>
                        订单编号：</label>
                    <input type="text" value="" placeholder="请输入订单编号" id="orderNum">
                    <label>
                        转账截止时间：</label>
                    <input class="laydate-icon" id="BeginDate" maxlength="16" name="BeginDate" type="text" value="" />

                    <input class="laydate-icon" id="EndDate" maxlength="16" name="EndDate" type="text" value="" />
                    <a href="javascript:void(0);" class="btn quireBtn">查询</a>
                    <a href="javascript:void(0);" onclick="Refresh()" class="btn refreshBtn">刷新</a>
                </div>
                <table class="layui-table">
                    <colgroup>
                        <col width="200">
                        <col width="100">
                        <col width="100">
                        <col width="120">
                        <col width="120">
                        <col width="100">
                        <col>
                        <col>
                    </colgroup>
                    <thead>
                        <tr>
                            <th>订单编号</th>
                            <th>银行卡</th>
                            <th>昵称</th>
                            <th>分行名称</th>
                            <th>开户人名称</th>
                            <th>转账状态</th>
                            <th>提现金额</th>
                            <th>提现时间</th>
                        </tr>
                    </thead>
                    <tbody class="debitLists">
                        <!-- <tr>
                            <td>指定推送任务</td>
                            <td>男</td>
                            <td>18-29</td>
                            <td>30000</td>
                            <td>指定推送任务</td>
                            <td>指定推送任务</td>
                            <td>指定推送任务</td>
                            <td>指定推送任务</td>
                        </tr> -->
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <script src="../js/jquery.min.js"></script>
    <script src="../js/jquery.cookie.js"></script>
    <script src="../js/dataRequest.js"></script>
    <script src="../js/timechange.js"></script>
    <script src="../layui/layui.js"></script>
    <script>
        $(".mhNav .navMenuBox > li > a").click(function (event) {
            if ($(this).siblings('ul').is(':visible')) {
                $(this).siblings('ul').stop(true, true).slideUp();
                $(this).removeClass('active')
            } else {
                $(this).siblings('ul').stop(true, true).slideDown().parents('li').siblings().find('ul').stop(true, true).slideUp();
                $(this).addClass('active').parents('li').siblings().find('a').removeClass('active');
            }
        });
    </script>
    <script>
        var mid = $.cookie("id");
        console.log("mid", mid);

        layui.use(['layer', 'laydate', 'form'], function () {
            var layer = layui.layer,
                laydate = layui.laydate,
                form = layui.form;
            Search({ merchantsId: mid });
            $(".quireBtn").on("click", function () {
                var status = $("#status option:selected").val();
                var orderNum = $("#orderNum").val();
                var startTime = $.cookie("beginT");
                var endTime = $.cookie("endT");
                console.log("123", startTime);
                Search({ merchantsId: mid, status: status, orderNum: orderNum, startTime: startTime, endTime: endTime });
            });
            function Search(data) {
                $.ajax({
                    url: BASE_URL + MAP_URL + "money/list",
                    // url: LOCAL_URL + MAP_URL + "money/list?merchantsId=" + mid + '&status=' + status + '&orderNum=' + orderNum + '&startTime=' + startTime + '&endTime=' + endTime,
                    type: 'GET',
                    dataType: 'json',
                    contentType: "application/json;charset=utf-8",
                    // data: JSON.stringify(JdateJson),
                    data: data,
                    success: function (data) {
                        // return;
                        console.log("请求到的数据", data);
                        if (!data.data || data.data == "") {
                            layer.msg("无数据");
                        }
                        var _Success = data.code;
                        if (_Success == 200) {
                            var str = "";
                            for (var i = 0; i < data.data.length; i++) {
                                var status;
                                switch (status = data.data[i].status) {
                                    case -1:
                                        status = "记录转账"
                                        break;
                                    case 0:
                                        status = "等待转账"
                                        break;
                                    case 1:
                                        status = "转账成功"
                                        break;
                                    default:
                                        status = "转账失败"
                                        break;
                                }
                                str += '<tr>';
                                str += '<td>' + data.data[i].orderNum + '</td>';
                                str += '<td>' + data.data[i].bankCard + '</td>';
                                str += '<td>' + data.data[i].boundWant + '</td>';
                                str += '<td>' + data.data[i].bankCardAddress + '</td>';
                                str += '<td>' + data.data[i].bankCardName + '</td>';
                                str += '<td>' + status + '</td>';
                                str += '<td>' + data.data[i].money + '</td>';
                                str += '<td>' + $.time.getTime(data.data[i].withdrawalTime, '', '/') + '</td>';
                                str += '</tr>';
                            }
                            $(".debitLists").append(str);
                            // layer.msg("请求成功");
                        } else {
                            layer.msg(data.data);
                        }
                    },
                    error: function () {
                        layer.msg("系统错误");
                    }
                });
            }
            //日期范围
            var startDate = laydate.render({
                elem: '#BeginDate',
                type: 'datetime',
                format: 'yyyy-MM-dd HH:mm',
                max: "2099-12-31",//设置一个默认最大值
                done: function (value, date) {
                    endDate.config.min = {
                        year: date.year,
                        month: date.month - 1, //关键
                        date: date.date,
                        hours: 0,
                        minutes: 0,
                        seconds: 0
                    };
                    console.log("你是我选择的开始日期", value);
                    var BeginDateT = $.time.dataCommon(value);
                    // return BeginDateT;
                    console.log("开始选择的日期", BeginDateT);
                    $.cookie("beginT", BeginDateT);

                }
            });

            var endDate = laydate.render({
                elem: '#EndDate',//选择器结束时间
                type: 'datetime',
                format: 'yyyy-MM-dd HH:mm',
                done: function (value, date) {
                    startDate.config.max = {
                        year: date.year,
                        month: date.month - 1,//关键
                        date: date.date,
                        hours: 0,
                        minutes: 0,
                        seconds: 0
                    }
                    console.log("你是我选择的结束日期", value);
                    var endDateT = $.time.dataCommon(value);
                    console.log("结束选择的日期", endDateT);
                    $.cookie("endT", endDateT);
                }
            });
        });
        $.ajax({
            type: "get",
            url: "http://47.92.174.143:8888/v1/client/merchants/" + mid,
            dataType: 'json',
            success: function (data) {
                // console.log("请求数据为", data.data)
                // 存储总额
                if (data.data == null || !data.data) {
                    layer.msg('数据出错,请重新登录', {
                        icon: 5,
                        time: 6000,
                        end: function () {
                            location.href = '/login.html';
                        }
                    });
                } else {
                    $(".userName").html(data.data.loginId);
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) { }
        });
    </script>
</body>

</html>